buikd: Fix the detection of udev with udevadm version < 128
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 2 Jul 2009 10:31:00 +0000 (11:31 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 2 Jul 2009 10:31:00 +0000 (11:31 +0100)
Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
install.sh
tools/check/check_udev
tools/hotplug/Linux/Makefile

index 77d24087f2444e2c8dd75a0e1cf81b101731966e..691214e638c97b1a9cf29cb151f26ab5bd9be3bb 100755 (executable)
@@ -30,7 +30,8 @@ echo "Installing Xen from '$src' to '$dst'..."
 [ -x "$(which udevinfo)" ] && \
   UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
 
-[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && UDEV_VERSION=$(/sbin/udevadm -V)
+[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && \
+  UDEV_VERSION=$(/sbin/udevadm info -V | awk '{print $NF}')
 
 if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
   echo " - installing for udev-based system"
index 7d4360d0b4f5c78c794ccd3372aeaf633f6d012d..27e557d2c222376f5cd1d5542201b4f3ec58411f 100755 (executable)
@@ -8,7 +8,8 @@ OpenBSD|NetBSD|FreeBSD)
        has_or_fail vnconfig
        ;;
 Linux)
-       has /sbin/udevadm && udevver=`/sbin/udevadm -V`
+       has /sbin/udevadm && \
+               udevver=`/sbin/udevadm info -V | awk '{print $NF}'`
        [ -z "$udevver" ] && has_or_fail udevinfo && \
                udevver=`udevinfo -V | awk '{print $NF}'`
        [ "$udevver" -ge 59 ] 2>/dev/null || \
index 8c7fe5d033672173e09b3382ede8ef3af53240dc..0fb56aa79a9ee6b237bfbd7a2f8a5e3c7bca6972 100644 (file)
@@ -24,10 +24,12 @@ XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
 XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
 XEN_HOTPLUG_SCRIPTS = xen-backend.agent
 
+UDEVVER = 0
 ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
-UDEVINFO = /sbin/udevadm
-else
-UDEVINFO = /usr/bin/udevinfo
+UDEVVER = $(shell /sbin/udevadm info -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
+endif
+ifeq ($(shell [ -x /usr/bin/udevinfo ] && echo 1),1)
+UDEVVER = $(shell /usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
 endif
 
 UDEV_RULES_DIR = $(CONFIG_DIR)/udev
@@ -38,7 +40,7 @@ DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
 ifeq ($(findstring $(DI),$(DE)),$(DI))
 HOTPLUGS=install-hotplug install-udev
 else
-ifeq ($(shell [ -x $(UDEVINFO) -a `$(UDEVINFO) -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
+ifeq ($(shell [ $(UDEVVER) -ge 059 ] && echo 1),1)
 HOTPLUGS=install-udev
 else
 HOTPLUGS=install-hotplug